import { initAuth } from '~/lib/auth-server' // Adjust the path as necessary
import type { LoaderFunctionArgs, ActionFunctionArgs } from "@remix-run/cloudflare"

export async function loader({ request, context }: LoaderFunctionArgs) {
  const auth = initAuth(context.cloudflare.env);
  return auth.handler(request)
}

export async function action({ request, context }: ActionFunctionArgs) {
  const auth = initAuth(context.cloudflare.env);
  return auth.handler(request)
}
